<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<!-- Breadcramps -->
<!-- 
<div class="page-title ui-widget-content ui-corner-all">
	<h1><a class="breadcrumb ui-state-default ui-corner-all" href="">Users</a></h1>
</div>
 -->

<div class="title">
	<h3>
		Users
	</h3>
	Add a new user
</div>

<div
	class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all form-container">
	<div class="portlet-content">

		<form:form method="post" modelAttribute="user" cssClass="forms">
			<spring:hasBindErrors name="user">
				<div class="response-msg error ui-corner-all">
					<spring:bind path="user">
						<c:forEach items="${status.errors.globalErrors}" var="error">
							<span><spring:message code="${error.code}"></spring:message></span>
						</c:forEach>
					</spring:bind>
					<spring:bind path="user.*">
						<c:forEach items="${status.errors.fieldErrors}" var="error">
							<spring:message code="${error.code}" ></spring:message><br>
						</c:forEach>
					</spring:bind>
				</div>
			</spring:hasBindErrors>

			<ul>
				<li>
					<label class="desc">
						User name
					</label>
					<div>
						<form:input path="username" cssClass="field text small" cssErrorClass="field text small error-field" />
					</div>
				</li>
				<li>
					<label class="desc">
						Password
					</label>
					<div>
						<form:password path="plainPassword" cssClass="field text small" cssErrorClass="field text small error-field" />
					</div>
				</li>
				<li>
					<label class="desc">
						Confirm password
					</label>
					<div>
						<form:password path="confirmPassword" cssClass="field text small" cssErrorClass="field text small error-field" />
					</div>
				</li>
				<li class="buttons">
					<input type="submit" value="Submit" class="submit" />
				</li>
			</ul>
		</form:form>
	</div>
</div>
<div class="clearfix"></div>